package com.waves.core.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {
    // 「沙箱环境」应用ID - 您的APPID
    public static String app_id = "2021000122648413";
    // 「沙箱环境」商户私钥 RSA2私钥 -【秘钥工具】所创建的应用私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDkG3TxjA+d2HQnhZLHlGfB6N0xGtcqcbDUDJeonFaQWrUHnb7ghgll4PNPqMUo9qBcCXgO8vPAcdiSyXs2MtEJbSvvzWgn8jjwynlxzJJfG3kiLG03Wts3xGMfDGcSJlgFrW0I9b1O0rBiyrmld2IqAQ/XxUGUxo/qE0lWuTYnuqOy+TTf1giKEGmHxSCeZMMl/Hv7/rZWjFdmvMBwLW1SESxTFQR4h/5eJH4olbYDQFtP8BxziUrCY9mdwIwSRFArRv+SsELh5CQCUVIAgyU05cyEQMVd8PBqbeu+Q1IVZdeMH1LWe+NAYHrr7iEHxDw1srceirea7ERLYjhY/jvDAgMBAAECggEABttUbpZZOdNx2mZHfTxWyhtn2rwFz77PI/Ck9mqMp5YybuItBK7CxY83gSN/mbWgKGQYecqPzS8e5Xqs+3oXkoL3mSPBh8HeOE69y8/sbnNy9rYDKnDOuiRrHlnPF1qTtsf5yRUp9Z6bsryJTBIEn2KcyU2ipQg69zxRLgwvNo51JYXOEx2whNnTLLr9+SWbfv4o5W+Zfi6daf7eL/YJlAuW4AM713iojrACa9LHFJG8W5KsmuqZRn+2m7ccRt8MvrwBeLt0C0KkBQWvq/ETI2uaO/VFfQoIowF+QiC5ci7wDyt+ZL7Y0aymG2oKKbGUjyxb7TgTbxWTUvXeRPoPAQKBgQD97a14SYCwvRwgWUYjam7kKvvaKCu/aqNuhCUO9VJ9mZpO+2HlxB8jBWvC8/663M+rhAROSURXUUv6KT7qEmeTI9kDv4Zjtsh/YdBPUj039PZ67X1bMAwFGDTdPwVc3wewtBZEb4piXvFfivjHq4m0h5vyl8T3KInSvC1XVycOgwKBgQDl99o2nq5Gk7tdYayjx6Mjxow2SDG074jMvJxZAbacSEvcnVadcYz6no+F8q3+nRuUVlAaXlo82bQwGQ8Ew2S3FFO1CVy2Av6gxbUo7yaZPPrMk/f8djVFHGgxofDSya4rP4h2lx+P4xADMzJ66/xhow3Jx3yiqulHIFW56aCZwQKBgEPs31ls+BLPE4YHu35fyzgX03UhB8rVgNBgYvVkZGOawi9ciWyIEPgyTAhDcqGTza2IzAoRCUn+Qj+x5tWAhNpUXYnmItHrpCiHBs0hJ6UfTwvFGaJZ8O0v83w3jnywYINBOS+nUrJLyW+QYkovNc/n8qxrMtIWsv9/PPW/J4B3AoGBAMbg60lTP7pvppjikK/vRan52mZTVxF4GiGdd8UN00QizeCT/UUZ32caW1rm/gx1CFXns0yqjnWTfN4fvbpL1Lz0ClRFLXWG73hQoxQshn/9mZP034DpJbaIE5/gwek5W7OxNS4CEdyY7M8npp9hmJlDrvfy2lm/XxEQ6LJoVmjBAoGBAOqLekgtvvUVjc6ykLTawu/xOu9MkjizT9RvN1oqHgWF1Zk/Bd//sAGPK1ttlP6DDigM1Pg7DL0t6Z6AVhQwdnX5SweY+PeAh47BTwfWbfFVDcbViQ1IpUB4KiQpW7pKFaboNiE4SexXphSXg+HfA/xZzFTfDtxBSbPmldG1N3qI";
    // 「沙箱环境」支付宝公钥 -【开放平台】提供给你的支付宝公钥
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmiJvWRuKIMonGn8D8z8l5ny0sJP/ec6WNimkeToGT61Ien7rSsGjmxDw0ZhDQEZb4K9vD+7goBfjYYV2NKuZbaBiS8HBSxlkgR+Gc+KISQhvDkqtEKcy5QZdy4aHn4+ac7SlDmXgbkHLat57z5SDhvWmwHINUK1nwGVI3TXd5zOCmy6QpnpnbcJA1R+yi5Ln/Y2MC2vnvpUK0xduW6mq7wWCn03NAQoBZ6ad+AdpckNz9dRzhKOZYo4Jjhy9gXjx1eRrZpRGnRfqSIi8d4j+OTvBh1wZfQl1yxkbWruX+qzis6zY/EShly7Uck5r1r8SkydhoIDk/+NnH9DBjhuHgQIDAQAB";
    // 「沙箱环境」
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    @Bean
    public AlipayClient alipayClient() {
        return  new DefaultAlipayClient(gatewayUrl,
                app_id,
                merchant_private_key,
                "json",
                charset,
                alipay_public_key,
                sign_type);
    }
}
